#include "Status.h"
#include <wx/intl.h>


namespace Impp{

wxString statusToString(const Status & status){
	//to understand this function see the operator== overloading in Status class
	wxString s;

	if(status == AWAY)
		s = wxT("Away");
	else if(status == DND)
		s = wxT("DND");
	else if(status == NA)
		s =  wxT("NA");
	else if(status == OCCUPIED)
		s =  wxT("Occupied");
	else if(status == FREE4CHAT)
		s = wxT("Free4Chat");
	else if(status == OFFLINE)
		s = wxT("Offline");
	else if(status == INVISIBLE){
		s = wxT("Invisible");
		//Status is Invisible it coud be not shoure
		//so check if it is so
		if(status == UNKNOWN){
			s << wxT(" (?)");
		}
		//we dont have to chceck for invisible or
		//Unknown again so return
		return s;
	}else if(status == UNKNOWN){
		//id statatus is unknown it can't be invisible
		//because we have checkt this above.
		//so return
		return wxT("Unknown");
	}else{
		return wxT("Online");
	}

	//status is an online status so check if it is invisible
	//and mark it.
	if(status == INVISIBLE)
		s << wxT(" (Invisible)");

	wxASSERT_MSG(!s.IsEmpty(), wxT("Status is not Valid, pls check the Status construction!"));

	return s;
}

}
